#include <string>
#include <iostream>
namespace code520 {
	using namespace std;
	class Solution {
	public:
		bool detectCapitalUse(string word) {
			int n = word.size();
			if (1 == n) { return true; }
			else if (islower(word[0])) {
				for (int i = 1; i < n; ++i) {
					if (isupper(word[i])) {
						return false;
					}
				}
			}
			else if (isupper(word[0])) {
				bool flag = isupper(word[1]);
				for (int i = 2; i < n; ++i) {
					cout << "i=" << i << " islower[i]=" << islower(word[i]) << endl;
					if (islower(word[i]) == flag) {
						return false;
					}
				}
			}
			return true;
		}
	};
	int _main(int arg, char* agrv[]) {
		Solution sol;
		string test("FFFFFFFFFFFFFFFFFFFFf");
		bool isRight = sol.detectCapitalUse(test);
		return 0;
	}
}
namespace code415 {
	using namespace std;
	class Solution {
	public:
		string addStrings(string num1, string num2) {
			int n1 = num1.size();
			int n2 = num2.size();
			string ans;
			int carry = 0;
			while (n1 > 0 && n2 > 0) {
				int sum = (num1[--n1] + num2[--n2] + carry);
				ans.push_back((sum % 10 + '0'));
				carry = sum / 10;
			}
			while (n1 > 0) {
				int sum = num1[--n1] + carry;
				ans.push_back(sum % 10 + '0');
				carry = sum / 10;
			}
			while (n2 > 0) {
				int sum = num2[--n2] + carry;
				ans.push_back(sum % 10 + '0');
				carry = sum / 10;
			}
			if (carry) {
				ans.push_back('1');
			}
			reverse(ans.begin(), ans.end());
			return ans;
		}
	};
	int _main(int agrc, char* agv[]) {
		Solution sol;
		return 0;
	}
}
//using namespace code520;
using namespace code415;
int main(int argc, char* argv[]) {
	_main(argc, argv);
	return 0;
}